<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@include file="/context/mytags.jsp" %>
<t:base type="jquery,easyui,tools,DatePicker"></t:base>
<div id="main_depart_list" class="easyui-layout" fit="true">
    <div region="center" style="padding: 1px;">
        <t:datagrid name="questSortList" title=""
                    actionUrl="questSortController.do?datatreegrid"
                    treegrid="true" idField="qsId" pagination="false">
            <t:dgCol title="主键" field="qsId" treefield="id" hidden="true"></t:dgCol>
            <t:dgCol title="分类名称" field="name" treefield="text" width="1"></t:dgCol>
            <t:dgCol title="分类描述" field="description" treefield="src" width="2"></t:dgCol>
            <%--<t:dgCol title="common.org.code" field="orgCode" treefield="fieldMap.orgCode"></t:dgCol>--%>
            <%--<t:dgCol title="common.org.type" field="orgType" dictionary="orgtype" treefield="code"></t:dgCol>--%>
            <t:dgCol title="common.operation" field="opt"></t:dgCol>
            <%--添加与修改、删除不开放--%>
            <t:dgDelOpt url="questSortController.do?del&qsId={id}" title="common.delete"></t:dgDelOpt>

            <%--<t:dgFunOpt funname="queryUsersByDepart(id)" title="view.member"></t:dgFunOpt>--%>
            <%--<t:dgFunOpt funname="setRoleByDepart(id,text,code)" title="role.set"></t:dgFunOpt>--%>

        </t:datagrid>
        <%--添加与修改、删除不开放--%>
        <div id="departListtb" style="padding: 3px; height: 25px">
            <div style="float: left;">
                <a href="#" class="easyui-linkbutton" plain="true" icon="icon-add" onclick="addInfor()">新增</a>
                <a href="#" class="easyui-linkbutton" plain="true" icon="icon-edit" onclick="updateInfor()">编辑</a>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">
    <!--
    //update-start--Author:zhangguoming  Date:20140821 for：为组织机构设置角色
    $(function () {
        var li_east = 0;
    });
    function addInfor() {
        var qsId = "";
        var rowsData = $('#questSortList').datagrid('getSelections');
        if (rowsData.length == 1) {
            qsId = rowsData[0].id;
        }
        var url = "questSortController.do?addorupdate&qsId=" + qsId;
        add("新增", url, "questSortList");
    }
    function updateInfor() {
        var qsId = "";
        var rowsData = $('#questSortList').datagrid('getSelections');
        if (rowsData.length == 1) {
            qsId = rowsData[0].id;
            var url = "questSortController.do?addorupdate&qsId=" + qsId;
            update("编辑", url,"questSortList");
        }else{
            tip("请选择一个类型后编辑");
            return false;
        }

    }

    <%--function queryUsersByDepart(departid){--%>
    <%--var title = '<t:mutiLang langKey="member.list"/>';--%>
    <%--if(li_east == 0 || $('#main_depart_list').layout('panel','east').panel('options').title != title){--%>
    <%--$('#main_depart_list').layout('expand','east');--%>
    <%--}--%>
    <%--&lt;%&ndash;$('#eastPanel').panel('setTitle','<t:mutiLang langKey="member.list"/>');&ndash;%&gt;--%>
    <%--$('#main_depart_list').layout('panel','east').panel('setTitle', title);--%>
    <%--$('#main_depart_list').layout('panel','east').panel('resize', {width: 500});--%>
    <%--$('#userListpanel').panel("refresh", "departController.do?userList&departid=" + departid);--%>
    <%--}--%>
    <%--/**--%>
    <%--* 为 组织机构 设置 角色--%>
    <%--* @param departid 组织机构主键--%>
    <%--* @param departname 组织机构名称--%>
    <%--*/--%>
    <%--function setRoleByDepart(departid, departname,orgType){--%>
    <%--var currentTitle = $('#main_depart_list').layout('panel', 'east').panel('options').title;--%>
    <%--if(li_east == 0 || currentTitle.indexOf("<t:mutiLang langKey="current.org"/>") < 0){--%>
    <%--$('#main_depart_list').layout('expand','east');--%>
    <%--}--%>
    <%--var title = departname + ':<t:mutiLang langKey="current.org"/>';--%>
    <%--$('#main_depart_list').layout('panel','east').panel('setTitle', title);--%>
    <%--$('#main_depart_list').layout('panel','east').panel('resize', {width: 200});--%>
    <%--var url = {--%>
    <%--&lt;%&ndash;title :"test",&ndash;%&gt;--%>
    <%--href:"roleController.do?roleTree&orgId=" + departid + "&orgType=" + orgType--%>
    <%--}--%>
    <%--$('#userListpanel').panel(url);--%>
    <%--$('#userListpanel').panel("refresh");--%>
    <%--}--%>
    <%--//update-end--Author:zhangguoming  Date:20140821 for：为组织机构设置角色--%>
    //-->
</script>